/**
   A rectangle with height and width.
*/
public class Rectangle
{
   private int height;
   private int width;

   /**
      Constructs a rectangle.
      @param aHeight: the height of the rectangle
      @param aWidth: the width of the rectangle
   */
   public Rectangle(int aHeight, int aWidth) 
   { 
      // your work here
      height = aHeight;
      width = aWidth;
   }

   /**
      Constructs a rectangle that is a square.
      @param aSide: the length of a side of the square
   */
   public Rectangle(int aSide) 
   { 
      // your work here
      height = aSide;
      width = aSide;
   }

   /**
      Computes the perimeter.
      @return the perimeter of the rectangle
   */
   public int perimeter() 
   {
      // your work here
      return height * 2 + width * 2;
   }

   /**
      Computes the area.
      @return the area of the rectangle
   */
   public int area() 
   {
      // your work here
      return height * width;
   }
   
   // This method is used for checking your work. Do not modify it

   public static String check(int h, int w, int sideSq)
   {
      Rectangle aRect = new Rectangle(h, w);
      Rectangle aSquare = new Rectangle(sideSq);
      return aRect.perimeter() + " " + aRect.area() + " "
           + aSquare.perimeter() + " " + aSquare.area();
   }
}